import 'package:flutter/material.dart';
import 'package:client/cardDemo/01cardDemo.dart'; // 导入你的 CardDemo 类

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  final String title;

  const MyHomePage({Key? key, required this.title}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),

      body: Stack(
        children: [
          // 背景图片
          Image.asset(
            'resources/images/tarotBg.png', // 替换为你的背景图片路径
            width: MediaQuery.of(context).size.width,
            height: MediaQuery.of(context).size.height,
            fit: BoxFit.cover,
          ),
          SingleChildScrollView(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                const Padding(
                  padding: EdgeInsets.all(8.0),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        'First Line of Text',
                        style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
                      ),
                      Text(
                        'Second Line of Text',
                        style: TextStyle(fontSize: 16),
                      ),
                    ],
                  ),
                ),
                SizedBox(
                  height: 200, // 调整滚动栏的高度
                  child: ListView(
                    scrollDirection: Axis.horizontal,
                    children: const [
                      CardDemo(
                        title: 'Card 1',
                        subtitle: 'Subtitle 1',
                      ),
                      CardDemo(
                        title: 'Card 2',
                        subtitle: 'Subtitle 2',
                      ),
                      CardDemo(
                        title: 'Card 3',
                        subtitle: 'Subtitle 3',
                      ),
                      // 添加更多 CardDemo
                    ],
                  ),
                ),
                const Padding(
                  padding: EdgeInsets.all(8.0),
                  child: Text(
                    'Bottom Line of Text',
                    style: TextStyle(fontSize: 16),
                  ),
                ),
                Container(
                  alignment: Alignment.bottomCenter,
                  child: Image.asset(
                    'resources/images/tarotTodayTarot.png', // 你的图片路径
                    width: 200,
                    height: 200,
                    fit: BoxFit.cover,
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
